package cn.iocoder.yudao.module.scrm.controller.admin.receivable.vo;

import cn.iocoder.yudao.module.scrm.controller.admin.commom.vo.FileInfoVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;

@Schema(description = "管理后台 - 回款新增/修改 Request VO")
@Data
public class ReceivableSaveReqVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32132")
    private Long id;

    @Schema(description = "订单号", example = "2138")
    @NotNull(message = "关联订单不能为空")
    private Long orderId;

    @Schema(description = "回款计划编号", example = "31443")
    private Long planId;

    @Schema(description = "客户编号", example = "26225")
    @NotNull(message = "关联客户不能为空")
    private Long customerId;

    @Schema(description = "合同编号", example = "14733")
    private Long contractId;

    @Schema(description = "负责人编号", example = "18541")
    private String ownerUserId;

    @Schema(description = "回款日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY, timezone = TIME_ZONE_DEFAULT)
    private LocalDateTime returnTime;

    @Schema(description = "回款方式,关联枚举CrmReceivableReturnTypeEnum", example = "1")
    @NotNull(message = "回款方式不能为空")
    private Integer returnType;

    @Schema(description = "计划回款金额", example = "6971")
    @NotNull(message = "计划回款金额不能为空")
    @DecimalMin (value = "0.00", message = "金额必须为大于或者等于0.00")
    @Digits(integer = 11, fraction = 2, message = "金额只能有11个整数和两位小数")
    private BigDecimal price;

    @Schema(description = "附件信息")
    private List<FileInfoVO> attachment;

    @Schema(description = "图片-附件信息", example = "https://www.iocoder.cn")
    @NotNull(message = "附件图片不能为空")
    private List<FileInfoVO> pictureAttachment;

    @Schema(description = "工作流编号", example = "26468")
    private Long processInstanceId;

    @Schema(description = "审批状态", example = "1")
    private Integer auditStatus;

    @Schema(description = "备注信息", example = "随便")
    private String remark;

}